import request from '@/utils/request'

// 查询采购退货申请单列表
export function listBuyBackReq(query) {
  return request({
    url: '/caigou/buyBackReq/list',
    method: 'get',
    params: query
  })
}

// 查询采购退货申请单详细
export function getBuyBackReqById(id) {
  return request({
    url: '/caigou/buyBackReq/' + id,
    method: 'get'
  })
}

// 查询根据采购退货单id查询采购退货申请单详细
export function getBuyBackReqDetailListByBuyBackReqId(buyBackReqId) {
  return request({
    url: '/caigou/buyBackReq/buyBackReqDetail/list/' + buyBackReqId,
    method: 'get'
  })
}

// 新增采购退货申请单
export function addBuyBackReq(data) {
  return request({
    url: '/caigou/buyBackReq',
    method: 'post',
    data: data
  })
}

// 修改采购退货申请单
export function updateBuyBackReq(data) {
  return request({
    url: '/caigou/buyBackReq',
    method: 'put',
    data: data
  })
}

// 删除采购退货申请单
export function delBuyBackReq(id) {
  return request({
    url: '/caigou/buyBackReq/' + id,
    method: 'delete'
  })
}
